package cz.muni.fi.pa165.business.dao;

import cz.muni.fi.pa165.business.entity.Picker;
import java.util.List;

/**
 * Interface defining CRUD operations manipulating with Picker entity
 *
 * @author Marek Tuhársky
 */
public interface PickerDAO {

    /**
     * Insert new Picker into database
     *
     * @param picker - new picker to create
     * @throws IllegalArgumentException if picker is null
     * @throws IllegalArgumentException if database already contains picker with
     * same nickname
     */
    public void createPicker(Picker picker);

    /**
     * Updates properties of an existing picker
     *
     * @param picker - picker object with modified attributes
     * @throws IllegalArgumentException if picker is null
     */
    public void updatePicker(Picker picker);

    /**
     * Removes a given picker from database
     *
     * @param picker - Picker object to be removed
     * @throws IllegalArgumentException if picker is null
     */
    public void deletePicker(Picker picker);

    /**
     * Returns Picker object with given id
     *
     * @param id - id of Picker to found
     * @throws IllegalArgumentException if id is invalid (null or negative)
     * @return Picker object with given id
     */
    public Picker getPicker(Long id);

    /**
     * Returns list of all pickers in database
     *
     * @return list of all pickers in database
     */
    public List<Picker> findAllPickers();

    /**
     * Returns picker in database with specific nickName
     *
     * @param nickName - nickName of picker to be found
     * @throws IllegalArgumentException if nickName is null
     * @return picker with given nickName
     */
    public Picker findPickerByNickName(String nickName);

    /**
     * Returns list of all pickers with given firsName in database
     *
     * @param firstName - firstName of pickers to be found
     * @throws IllegalArgumentException if firstName is null
     * @return list of all pickers in database with given firstName
     */
    public List<Picker> findPickersByFirstName(String firstName);

    /**
     * Returns list of all pickers with given lastName in database
     *
     * @param lastName - lastName of pickers to be found
     * @throws IllegalArgumentException if lastName is null
     * @return list of all pickers in database with given lastName
     */
    public List<Picker> findPickersByLastName(String lastName);
}
